package com.zx.mes.senior.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author huayunlong
 * @date 2018-9-12
 */
public class JdkProxy implements InvocationHandler {

    private Person person;

    public JdkProxy(Person person) {
        this.person = person;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        System.out.println("---------- 方法执行之前 ----------");

        method.invoke(person, args);

        System.out.println("---------- 方法执行之后 ----------");

        return null;
    }
}
